![]() |
Custom Printer Library
1.17
|
Contains all library APIs. Main file for CuCustomLnxAPI library. More...
#include "customprnapi.h"Functions | |
| CcwResult | InitLibrary (CcwLogVerbosity logVerbosityLevel, char *pstrLogFolder) |
| CcwResult | DeInitLibrary () |
| CcwResult | CloseDevice (int device) |
| CcwResult | CloseAllDevices () |
| CcwResult | GetAPIVersion (char *pAPIVersion) |
| CcwResult | GetInfoPrinterId (int device, WORD *pwPrinterID) |
| CcwResult | GetInfoFirmwareVersion (int device, char *pFirmwareVersion) |
| CcwResult | GetInfoDeviceModel (int device, char *pDeviceModel) |
| CcwResult | GetCapCommPortType (int device, CommunicationPortType *pcomPortType) |
| CcwResult | GetCapPrintAvailable (int device, BOOL *pbPrnAvailable) |
| CcwResult | GetCapPrinterResolution (int device, DWORD *pdwPrinterResolution) |
| CcwResult | GetCapPrintWidth (int device, DWORD *pdwPageWidth) |
| CcwResult | SetCapPrintWidth (int device, DWORD dwNewPrintWidth) |
| CcwResult | CommGetReadTimeout (int device, DWORD *pdwRTimeout) |
| CcwResult | CommSetReadTimeout (int device, DWORD dwRTimeout) |
| CcwResult | CommGetWriteTimeout (int device, DWORD *pdwWTimeout) |
| CcwResult | CommSetWriteTimeout (int device, DWORD dwWTimeout) |
| CcwResult | CommClearReadBuffer (int device) |
| CcwResult | CommClearWriteBuffer (int device) |
| CcwResult | CommRead (int device, BYTE *bDataRead, DWORD dwDataReadSize, DWORD *pdwReadDataSize) |
| CcwResult | CommWrite (int device, BYTE *bDataToWrite, DWORD dwDataToWriteSize, DWORD *pdwWrittenData) |
| CcwResult | TransactionPrint (DWORD device, TrPrintMode tpMode) |
| CcwResult | Feed (int device, DWORD dwnFeeds) |
| CcwResult | Cut (int device, CutType cuttype) |
| CcwResult | EjectWithTimeout (int device, EjectType ejtype, DWORD dwTimeoutMs) |
| CcwResult | Eject (int device, EjectType ejtype) |
| CcwResult | Present (int device, DWORD dwpresentMM) |
| CcwResult | Align (int device, PaperAlignType aligntype) |
| CcwResult | PrinterIsReady (int device, BOOL *pbReady) |
| CcwResult | GetPrinterFullStatus (int device, BYTE *pBuffer, PrinterStatusStruct *pStatusStruct) |
| CcwResult | ClearPrinterStatisticsField (int device, ClearableField fieldToClear) |
| CcwResult | GetPrinterStatistics (int device, PrinterStatisticsStruct *printerStatisticsStruct) |
| CcwResult | PrintText (int device, char *pText, BOOL bAddLF) |
| CcwResult | PrintTextUTF8 (int device, char *pText, PrintFontStruct *pfontStruct, BOOL bAddLF) |
| CcwResult | PrintTextEx (int device, char *pText, PrintFontStruct *pfontStruct, BOOL bAddLF) |
| CcwResult | SetIgnoreWhiteImages (int device, BOOL bIgnore) |
| CcwResult | SetGrModeToBlackWhite (int device, ImageGRMode imgGrModeType, BYTE bThreshold) |
| CcwResult | SetPageModeToRoll (int device, BOOL bRollMode) |
| CcwResult | PrintImageFromPath (int device, char *pstrImageFilePath, PrintImageStruct *pImageStruct) |
| CcwResult | PrintRawImage (int device, RAWBitDepth bits, BYTE *pRawBuffer, DWORD dwRawBufferSize, DWORD dwWidth, DWORD dwHeight, PrintImageStruct *pImageStruct) |
| CcwResult | PrintBarcodeString (int device, char *strBrcText, PrintBarcodeStruct *pBarcodeStruct) |
| CcwResult | PrintBarcodeBuffer (int device, BYTE *bBrcBuffer, DWORD dwSrcBufferSize, PrintBarcodeStruct *pBarcodeStruct) |
| CcwResult | SetVariable (int device, char *var, void *value) |
| CcwResult | GetVariable (int device, char *var, void *value) |
| CcwResult | EnumUSBDevices (USBDeviceStruct *pUSBDevicesArray, DWORD *pdwNumDevices) |
| CcwResult | OpenPrinterUSB (WORD wVID, WORD wPID, char *pstrSN, int *pPrinterDevID) |
| CcwResult | OpenPrinterUSBEx (USBDeviceStruct *pUsbDev, int *pPrinterDevID) |
| CcwResult | EnumETHDevices (ETHDeviceStruct *pETHDevicesArray, unsigned long *pdwNumDevices, DWORD dwSearchTimeout) |
| CcwResult | OpenPrinterETH (char *strPrinterIPAddress, int dwPrinterIPPort, int *pdeviceID) |
| CcwResult | OpenPrinterETHEx (ETHDeviceStruct *pEthDev, int *pPrinterDevID) |
| CcwResult | EnumCOMPorts (COMPortStruct *pCOMPortsArray, unsigned long *pdwNumPorts) |
| CcwResult | OpenPrinterCOM (char *strPrinterComPort, int *pPrinterDevID) |
| CcwResult | OpenPrinterCOMEx (COMPortStruct *pComDev, int *pPrinterDevID) |
Contains all library APIs. Main file for CuCustomLnxAPI library.
| CcwResult Align | ( | int | device, |
| PaperAlignType | aligntype | ||
| ) |
Send align command to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | aligntype | the PaperAlignType type to send to the device. |
| CcwResult ClearPrinterStatisticsField | ( | int | device, |
| ClearableField | fieldToClear | ||
| ) |
Get the statistics of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | fieldToClear | The ClearableField field that will be cleared. |
| CcwResult CloseAllDevices | ( | ) |
Close the communication with all the devices.
| CcwResult CloseDevice | ( | int | device | ) |
Close the communication with a device.
| [in] | device | The device ID indicating which device the application will close the communications. |
| CcwResult CommClearReadBuffer | ( | int | device | ) |
Clean the read buffer of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| CcwResult CommClearWriteBuffer | ( | int | device | ) |
Clean the write buffer of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| CcwResult CommGetReadTimeout | ( | int | device, |
| DWORD * | pdwRTimeout | ||
| ) |
Get the read timeout of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pdwRTimeout | A pointer to the number that is the read timeout (msec), for the communication port, of this device. |
| CcwResult CommGetWriteTimeout | ( | int | device, |
| DWORD * | pdwWTimeout | ||
| ) |
Get the write timeout of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pdwWTimeout | A pointer to the number that is the write timeout (msec), for the communication port, of this device. |
| CcwResult CommRead | ( | int | device, |
| BYTE * | bDataRead, | ||
| DWORD | dwDataReadSize, | ||
| DWORD * | pdwReadDataSize | ||
| ) |
Direct read from communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | bDataRead | pointer to buffer where received data shall stored |
| [in] | dwDataReadSize | length of reserved buffer |
| [out] | pdwReadDataSize | pointer to value where the number of received bytes is stored |
| CcwResult CommSetReadTimeout | ( | int | device, |
| DWORD | dwRTimeout | ||
| ) |
Set the read timeout of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | dwRTimeout | the value that will be the new read timeout (msec), for the communication port, of this device. |
| CcwResult CommSetWriteTimeout | ( | int | device, |
| DWORD | dwWTimeout | ||
| ) |
Set the write timeout of the communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | dwWTimeout | the value that will be the write timeout (msec), for the communication port, of this device. |
| CcwResult CommWrite | ( | int | device, |
| BYTE * | bDataToWrite, | ||
| DWORD | dwDataToWriteSize, | ||
| DWORD * | pdwWrittenData | ||
| ) |
Direct write to communication port of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | bDataToWrite | pointer to buffer to send |
| [in] | dwDataToWriteSize | length of buffer to send |
| [out] | pdwWrittenData | pointer to value where the number of sent bytes is stored |
Send cut command to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | cuttype | the CutType type to send to the device. |
| CcwResult DeInitLibrary | ( | ) |
De-initialize library. Call this function as the last function before your application unloads the library.
Send eject command to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | ejtype | the EjectType type to send to the device. |
Send eject command to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | ejtype | the EjectType type to send to the device. |
| [in] | dwTimeoutMs | the time in milliseconds after which the movement is performed. |
| CcwResult EnumCOMPorts | ( | COMPortStruct * | pCOMPortsArray, |
| unsigned long * | pdwNumPorts | ||
| ) |
Enum the COM Ports found.
| [out] | pCOMPortsArray | the pointer to COMPortStruct array of all the COM ports found. This array must have been allocated by the calling process. |
| [out] | pdwNumPorts | The pointer to the value indicating the number of COM Ports found. |
| CcwResult EnumETHDevices | ( | ETHDeviceStruct * | pETHDevicesArray, |
| unsigned long * | pdwNumDevices, | ||
| DWORD | dwSearchTimeout | ||
| ) |
Enum the Ethernet/Wifi devices connected.
| [out] | pETHDevicesArray | the pointer to ETHDeviceStruct array of all the Ethernet/Wifi devices found. This array must have been allocated by the calling process. |
| [out] | pdwNumDevices | The pointer to the value indicating the number of Ethernet/Wifi devices found. |
| [in] | dwSearchTimeout | The timeout to search the ethernet / wifi devices |
| CcwResult EnumUSBDevices | ( | USBDeviceStruct * | pUSBDevicesArray, |
| DWORD * | pdwNumDevices | ||
| ) |
Enum the usb devices connected.
| [out] | pUSBDevicesArray | the pointer to USBDeviceStruct array of all the usb devices found. This array must have been allocated by the calling process. |
| [out] | pdwNumDevices | The pointer to the value indicating the number of usb devices found. |
| CcwResult Feed | ( | int | device, |
| DWORD | dwnFeeds | ||
| ) |
Send line feed commands to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | dwnFeeds | the number of line feed to send to the device. |
| CcwResult GetAPIVersion | ( | char * | pAPIVersion | ) |
Current API version
| [out] | pAPIVersion | A null terminated string containing the library release. This buffer must have been allocated by the calling process. |
| CcwResult GetCapCommPortType | ( | int | device, |
| CommunicationPortType * | pcomPortType | ||
| ) |
Get the type of communication port used by the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pcomPortType | A pointer to CommunicationPortType, allocated by the calling process, that contains the communication port type. |
| CcwResult GetCapPrintAvailable | ( | int | device, |
| BOOL * | pbPrnAvailable | ||
| ) |
Get if this device supports print functions.
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pbPrnAvailable | A pointer to the boolean value to know if this device supports print functions. |
| CcwResult GetCapPrinterResolution | ( | int | device, |
| DWORD * | pdwPrinterResolution | ||
| ) |
Get the print resolution of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pdwPrinterResolution | A pointer to the number that is the print resolution. |
| CcwResult GetCapPrintWidth | ( | int | device, |
| DWORD * | pdwPageWidth | ||
| ) |
Get the print width of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pdwPageWidth | A pointer to the number that is the print width (dots) of this device. |
| CcwResult GetInfoDeviceModel | ( | int | device, |
| char * | pDeviceModel | ||
| ) |
Get the Device Model
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pDeviceModel | A null terminated string containing the Model of this device. This buffer must have been allocated by the calling process. |
| CcwResult GetInfoFirmwareVersion | ( | int | device, |
| char * | pFirmwareVersion | ||
| ) |
Get the Firmware Version
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pFirmwareVersion | A null terminated string containing the Firmware release of this device. This buffer must have been allocated by the calling process. |
| CcwResult GetInfoPrinterId | ( | int | device, |
| WORD * | pwPrinterID | ||
| ) |
Get the Printer ID
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pwPrinterID | A WORD containing the Printer ID. |
| CcwResult GetPrinterFullStatus | ( | int | device, |
| BYTE * | pBuffer, | ||
| PrinterStatusStruct * | pStatusStruct | ||
| ) |
Get the status of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pBuffer | A pointer to 4 bytes buffer, allocated by the calling process, that contains the printer status. |
| [out] | pStatusStruct | A pointer to PrinterStatusStruct, allocated by the calling process, that contains the printer status. |
| CcwResult GetPrinterStatistics | ( | int | device, |
| PrinterStatisticsStruct * | printerStatisticsStruct | ||
| ) |
Get the statistics of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | printerStatisticsStruct | A pointer to PrinterStatisticsStruct, allocated by the calling process, that contains the printer statistics. |
| CcwResult GetVariable | ( | int | device, |
| char * | var, | ||
| void * | value | ||
| ) |
Get the value of an internal "parameter"
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | var | A null terminated string that is the variable ID. |
| [out] | value | pointer to the value of the variable. |
| CcwResult InitLibrary | ( | CcwLogVerbosity | logVerbosityLevel, |
| char * | pstrLogFolder | ||
| ) |
Initializes library. This must be the first call after the LoadLibrary.
| [in] | logVerbosityLevel | a CcwLogVerbosity Verbosity level. |
| [in] | pstrLogFolder | Log folder path. If NULL or empty, the library uses the default path: "%Home%/CUSTOM/CuCustomLnxAPI/Log". |
| CcwResult OpenPrinterCOM | ( | char * | strPrinterComPort, |
| int * | pPrinterDevID | ||
| ) |
Open the communication with a COM port to printer
| [in] | strPrinterComPort | the string with the COM port to open. |
| [out] | pPrinterDevID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult OpenPrinterCOMEx | ( | COMPortStruct * | pComDev, |
| int * | pPrinterDevID | ||
| ) |
Open the communication with a COM port to printer
| [in] | pComDev | the COMPortStruct with all the parameters of the COM Port to open. |
| [out] | pPrinterDevID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult OpenPrinterETH | ( | char * | strPrinterIPAddress, |
| int | dwPrinterIPPort, | ||
| int * | pdeviceID | ||
| ) |
Open the communication with a Ethernet / WIFI printer
| [in] | strPrinterIPAddress | the string with the IP Address of the printer to open. |
| [in] | dwPrinterIPPort | the network port to open int the printer. If this value is 0, it is automatically set to the default for the RAW print port (9100) |
| [out] | pdeviceID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult OpenPrinterETHEx | ( | ETHDeviceStruct * | pEthDev, |
| int * | pPrinterDevID | ||
| ) |
Open the communication with a Ethernet / WIFI printer
| [in] | pEthDev | the ETHDeviceStruct with all the parameters of the ETH/Wifi printer to open. |
| [out] | pPrinterDevID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult OpenPrinterUSB | ( | WORD | wVID, |
| WORD | wPID, | ||
| char * | pstrSN, | ||
| int * | pPrinterDevID | ||
| ) |
Open the communication with a USB printer
| [in] | wVID | the USB Vendor ID of the printer to open. |
| [in] | wPID | the USB Product ID of the printer to open. |
| [in] | pstrSN | the USB Serial Number of the printer to open. |
| [out] | pPrinterDevID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult OpenPrinterUSBEx | ( | USBDeviceStruct * | pUsbDev, |
| int * | pPrinterDevID | ||
| ) |
Open the communication with a USB printer
| [in] | pUsbDev | the USBDeviceStruct with all the parameters of the USB printer to open. |
| [out] | pPrinterDevID | The pointer to the device ID indicating which device the application will communicate to. |
| CcwResult Present | ( | int | device, |
| DWORD | dwpresentMM | ||
| ) |
Send presentation command to the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | dwpresentMM | the value (mm) of the presentation to send to the device. |
| CcwResult PrintBarcodeBuffer | ( | int | device, |
| BYTE * | bBrcBuffer, | ||
| DWORD | dwSrcBufferSize, | ||
| PrintBarcodeStruct * | pBarcodeStruct | ||
| ) |
Print barcode file from buffer
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | bBrcBuffer | pointer to buffer to print into barcode |
| [in] | dwSrcBufferSize | length of buffer to print into barcode |
| [in] | pBarcodeStruct | the pointer to PrintBarcodeStruct with all the parameters / Attributes to use to print the barcode. |
| CcwResult PrintBarcodeString | ( | int | device, |
| char * | strBrcText, | ||
| PrintBarcodeStruct * | pBarcodeStruct | ||
| ) |
Print barcode file from String
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | strBrcText | A null terminated string to print into barcode. |
| [in] | pBarcodeStruct | the pointer to PrintBarcodeStruct with all the parameters / Attributes to use to print the barcode. |
| CcwResult PrinterIsReady | ( | int | device, |
| BOOL * | pbReady | ||
| ) |
Check if the device is ready
| [in] | device | The device ID indicating which device the application will communicate to. |
| [out] | pbReady | A pointer to a boolean value that is true if the communication with the device is ok. |
| CcwResult PrintImageFromPath | ( | int | device, |
| char * | pstrImageFilePath, | ||
| PrintImageStruct * | pImageStruct | ||
| ) |
Print image file from path.
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | pstrImageFilePath | A null terminated string with the file path. |
| [in] | pImageStruct | the pointer to PrintImageStruct with all the parameters / Attributes to use to print the image. |
| CcwResult PrintRawImage | ( | int | device, |
| RAWBitDepth | bits, | ||
| BYTE * | pRawBuffer, | ||
| DWORD | dwRawBufferSize, | ||
| DWORD | dwWidth, | ||
| DWORD | dwHeight, | ||
| PrintImageStruct * | pImageStruct | ||
| ) |
Print RAW image buffer.
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | bits | bit deph of the RAW data |
| [in] | pRawBuffer | pointer to RAW buffer to print |
| [in] | dwRawBufferSize | length of RAW buffer to print |
| [in] | dwWidth | width (pixels/dots) of the of RAW image |
| [in] | dwHeight | height (pixels/dots) of the of RAW image |
| [in] | pImageStruct | the pointer to PrintImageStruct with all the parameters / Attributes to use to print the image. |
| CcwResult PrintText | ( | int | device, |
| char * | pText, | ||
| BOOL | bAddLF | ||
| ) |
Print text on a printer.
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | pText | A null terminated string to print. |
| [in] | bAddLF | The boolean that is true if must be sent a line feed command after the text. |
| CcwResult PrintTextEx | ( | int | device, |
| char * | pText, | ||
| PrintFontStruct * | pfontStruct, | ||
| BOOL | bAddLF | ||
| ) |
Print text on a printer (with text parameters / Attributes ).
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | pText | A null terminated string to print. |
| [in] | pfontStruct | The pointer to PrintFontStruct with all the parameters / Attributes to use to print the text. |
| [in] | bAddLF | The boolean that is true if must be send a line feed command after the text. |
| CcwResult PrintTextUTF8 | ( | int | device, |
| char * | pText, | ||
| PrintFontStruct * | pfontStruct, | ||
| BOOL | bAddLF | ||
| ) |
Print UTF-8 text on a printer (with text parameters / Attributes ).
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | pText | A null terminated UTF-8 encoded string to print. |
| [in] | pfontStruct | The pointer to PrintFontStruct with all the parameters / Attributes to use to print the text. |
| [in] | bAddLF | The boolean that is true if must be sent a line feed command after the text. |
| CcwResult SetCapPrintWidth | ( | int | device, |
| DWORD | dwNewPrintWidth | ||
| ) |
Set the print width of this device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | dwNewPrintWidth | The number that will be the print width (dots) of this device. |
| CcwResult SetGrModeToBlackWhite | ( | int | device, |
| ImageGRMode | imgGrModeType, | ||
| BYTE | bThreshold | ||
| ) |
Set the graphic conversion mode to Black/White and, if necessary, the threshold
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | imgGrModeType | the ImageGRMode conversion to black / white mode. |
| [in] | bThreshold | the threshold value to use (only for ImageGRMode::IMAGE_GRMODE_THRESHOLD mode). |
| CcwResult SetIgnoreWhiteImages | ( | int | device, |
| BOOL | bIgnore | ||
| ) |
Set if ignore, or not, the white Images
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | bIgnore | The boolean that is true when a totally white Image must be ignored and not print (default is false). |
| CcwResult SetPageModeToRoll | ( | int | device, |
| BOOL | bRollMode | ||
| ) |
Set the page mode print to Roll mode.
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | bRollMode | The boolean that is true when the printer prints until the last not white line (default is false). |
| CcwResult SetVariable | ( | int | device, |
| char * | var, | ||
| void * | value | ||
| ) |
Set the value of an internal "parameter"
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | var | A null terminated string that is the variable ID. |
| [in] | value | pointer to the value to assign to the variable. |
| CcwResult TransactionPrint | ( | DWORD | device, |
| TrPrintMode | tpMode | ||
| ) |
Manage the Transaction Print of the device
| [in] | device | The device ID indicating which device the application will communicate to. |
| [in] | tpMode | Transaction control (see TrPrintMode). |